<template>
  <li class="list-group-item">
    <div class="handle">
      <a href="javascript:;" @click="del">删除</a>
    </div>
    <p class="user"><span >{{comment.user}}</span><span>说:</span></p>
    <p class="centence">{{comment.content}}</p>
  </li>
</template>

<script>
export default {
  name: "Comment",
  props:{'comment':Object,
         'delComment':{
          type:Function,
           require:true
         },
         'index':Number
       },
  methods:{
    del(){
      let {comment,index} =this;
      if(window.confirm(`确认删除${comment.user}的评论么？`)){
        this.delComment(index)
      }
    }
  }
}
</script>

<style scoped>

</style>
